﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Game.Facade;
using Game.Kernel;
using Game.Utils;
using Game.Entity.Accounts;
using Game.Entity.Treasure;

namespace Game.Card
{
    public partial class Index : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteMaster.Menu = 0;
            if(!IsPostBack)
            {
                //获取登录信息
                UserTicketInfo user = userTicket;
                lbAccount.Text = user.Accounts;
                //获取代理信息
                AccountsAgent agent = FacadeManage.aideAccountsFacade.GetAccountAgentByUserID(user.UserID);
                if(agent != null)
                {
                    lbDomain.Text = agent.Domain;
                    lbMobile.Text = agent.MobilePhone;
                    lbNumber.Text = agent.AgentID.ToString();
                    lbRealName.Text = agent.Compellation;
                    lbWechat.Text = agent.WeChat;
                }
                //获取游戏币信息
                GameScoreInfo score = FacadeManage.aideTreasureFacade.GetTreasureInfo2(user.UserID);
                if(score != null)
                {
                    lbGold.Text = score.Score.ToString();
                }
                //获取房卡信息
                UserRoomCard card = FacadeManage.aideTreasureFacade.GetUserRoomCard(user.UserID);
                if(card != null)
                {
                    lbRoomCard.Text = card.RoomCard.ToString();
                }

                //获取公告信息
                rpData.DataSource = FacadeManage.aideNativeWebFacade.GetRoomCardNews(4);
                rpData.DataBind();
            }
        }
    }
}